#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cstdio>
using namespace std;

int main()
{
	char ch;
	int ans = 0;
	do {
		scanf("%c", &ch);
		if (ch != ' ' && ch != '\n')ans++;
		if (ch == '\n')break;
	} while (1);
	cout << ans;
	return 0;
}